﻿#!/usr/bin/env python3

def main():
    '''
几个应当熟悉的builtin functions:

all(), 全真时为真
any(), 存真时为真

chr(i),     unicode码值i对应字符的字串
ord(c),     字符c的unicode码值

bin(x), 转为0b形式的二进制
oct(x), 转为0o形式的二进制
hex(x)
int(x, base=10),  
float(x)
bool(x),   True or False

max(iterable, *[, key, default])
max(arg1, arg2, *args[, key])
min(iterable, *[, key, default])
min(arg1, arg2, *args[, key])
    存在多个最值时,返回第一个

isinstance(object, classinfo)
issubclass(class, classinfo)
callable(object)

hasattr(object, name)
setattr(object, name, value)
delattr()

ascii(), obj的字串表示, 约同于repr()
repr()
str()

bytearray()
bytes()
list()
tuple()
set()
frozenset()
dict()

class property(fget=None, fset=None, fdel=None, doc=None)

locals()
globals()
vars()

eval(expression, globals=None, locals=None)
exec(object[, globals[, locals]])
compile()

iter()
next()

format(value[, format_spec])

input([prompt])
open()

sorted(iterable, *, key=None, reverse=False)

super([type[, object-or-type]])
    Return a proxy object that delegates method calls to a parent or sibling class of type

@classmethod
@staticmethod

    '''
    print(main.__doc__)
    print("all([1,True,\"True\"]) = {0}".format(all([1,True,"True"])))
    print("all([[1,False]]) = {0}".format(all([1,False])))
    print("any([0,True,\"False\"]) = {0}".format(any([0,True,"False"])))
    print("any([[0,False]]) = {0}".format(any([0,False])))
    print("ord('大')={0}".format(ord('大')))
    print("chr(0x5927)={0}".format(chr(0x5927)))
    print("ascii('大')={0}".format(ascii('大')))
    print("ascii('a')={0}".format(ascii('a')))
    print("bin(20)={0}".format(bin(20)))
    print("max(3,1,5,2)={0}".format(max(3,1,5,2)))
    
    class A: pass
    class B(A):pass 
    b = B()
    print("isinstance(b, B)={0}".format(isinstance(b,B)))
    print("issubclass(B, A)={0}".format(issubclass(B, A)))


if __name__ == "__main__":
    main()
